//
// Created by luolijun on 2021/11/6.
//

#include "FacadeNote.h"

namespace falcon {
FacadeNote::FacadeNote() {
    _object->type = "Note";
}

FacadeNote::~FacadeNote() {
}

uint32_t FacadeNote::scope() const {
    return Scope::SCOPE_COMMON;
}

void FacadeNote::draw(falcon::Painter& canvas) {
    Q_ASSERT(_object != nullptr);
    canvas.drawText(rect(), falcon::AlignCenter, _object->groupOf("base").attrOf("text").value.c_str());
}

Facade* FacadeNote::clone() const {
    FacadeNote* newfc = new FacadeNote();
    newfc->_size = _size;
    newfc->_center = _center;
    newfc->_object = new falcon::Object;
    newfc->_styles = new falcon::Styles;
    return newfc;
}

} // namespace falcon
